package com.sxj.springsourcecode.springframework.io.support;

import com.sxj.springsourcecode.springframework.io.config.Resource;

import java.io.InputStream;

/**
 * @ProjectName: spring-source-code
 * @Package: com.sxj.springsourcecode.springframework.io.support
 * @ClassName: ClassPathResource
 * @Author: sxj
 * @Description:
 * @Date: 2024/2/21 22:40
 * @Version: 1.0.0
 */
public class ClassPathResource implements Resource {
    private String path;

    public ClassPathResource(String path) {
        this.path = path;
    }

    @Override
    public InputStream getInputStream() {
        InputStream inputStream = ClassPathResource.class.getClassLoader().getResourceAsStream(this.path);
        return inputStream;
    }
}
